package mediator.impl;

import mediator.AbstractBroadCast;
import mediator.HearAble;
import mediator.Speaker;

public class Teacher extends Speaker implements HearAble{
    public Teacher(String name, AbstractBroadCast broadCast) {
        super(name, broadCast);
    }

    @Override
    public void speak(String message) {
        System.out.println(this.name + " 说：" + message);
        broadCast.send(this,message);
    }

    @Override
    public void hear(Speaker speaker, String message) {
        System.out.println(this.name + "听到" + speaker.name+"说：" + message);
    }

}
